package com.danciyixue.boot.dcyx.model.form;

import java.io.Serial;
import java.io.Serializable;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import java.time.LocalDateTime;
import com.fasterxml.jackson.annotation.JsonFormat;
import jakarta.validation.constraints.*;

/**
 * 用户当前选择单元信息表单对象
 *
 * @author youlaitech
 * @since 2025-06-15 16:36
 */
@Getter
@Setter
@Schema(description = "用户当前选择单元信息表单对象")
public class UserCurrentUnitsForm implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "用户匹配单元的ID")
    private Long id;

    @Schema(description = "用户ID")
    @NotNull(message = "用户ID不能为空")
    private Long userId;

    @Schema(description = "用户名")
    @Size(max=64, message="用户名长度不能超过64个字符")
    private String username;

    @Schema(description = "当前系列ID")
    private Long seriesId;

    @Schema(description = "学期ID")
    private Long semesterId;

    @Schema(description = "当前教材ID")
    @NotNull(message = "当前教材ID不能为空")
    private Long programId;

    @Schema(description = "当前单词ID")
    private Long wordId;

    @Schema(description = "当前单词索引")
    private Integer wordIdx;

    @Schema(description = "分组ID")
    @Size(max=64, message="分组ID长度不能超过64个字符")
    private String groupId;

    @Schema(description = "加固标识")
    @Size(max=64, message="加固标识长度不能超过64个字符")
    private String fortify;

    @Schema(description = "当前单元ID")
    // 移除 @NotNull 验证，允许 unitId 为空（当 programId 不为空时会自动查找第一个单元）
    private Long unitId;

    @Schema(description = "单元名称")
    @Size(max=128, message="单元名称长度不能超过128个字符")
    private String unitName;

    @Schema(description = "来源")
    @Size(max=64, message="来源长度不能超过64个字符")
    private String source;

    @Schema(description = "错误次数")
    // 移除 @NotNull 验证，允许为空（新记录时会设置默认值0）
    private Integer errors;

    @Schema(description = "正确次数")
    // 移除 @NotNull 验证，允许为空（新记录时会设置默认值0）
    private Integer rights;

    @Schema(description = "是否结束")
    // 移除 @NotNull 验证，允许为空（新记录时会设置默认值0）
    private Integer isEnd;

    @Schema(description = "错误单词信息")
    // 移除 @NotBlank 验证，允许为空（新记录时会设置默认值""）
    @Size(max=65535, message="错误单词信息长度不能超过65535个字符")
    private String errorWordInfo;


}
